package com.jack006.api.controller.user;

import com.jack006.api.config.MyServiceList;
import com.jack006.api.controller.user.fallbacks.UserControllerFactoryFallback;
import com.jack006.grace.result.GraceJSONResult;
import com.jack006.pojo.bo.UpdateUserInfoBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * @Classname UserControllerApi
 * @Description 用户信息相关
 * @Date 2021-06-13 10:27
 * @Created by jack
 */
@Api(value = "用户信息相关的 controller", tags = "用户信息相关的 controller")
@FeignClient(value = MyServiceList.SERVICE_USER,qualifier = MyServiceList.SERVICE_USER,fallbackFactory = UserControllerFactoryFallback.class)
public interface UserControllerApi {

    @ApiOperation(value = "获取用户基本信息", notes="获取用户基本信息",httpMethod = "POST")
    @PostMapping("/user/getUserInfo")
    GraceJSONResult getUserInfo(@RequestParam("userId") String userId);

    @ApiOperation(value = "获取用户账户信息", notes="获取用户账户信息",httpMethod = "POST")
    @PostMapping("/user/getAccountInfo")
    GraceJSONResult getAccountInfo(@RequestParam("userId") String userId);


    @ApiOperation(value = "获修改/完善用户信息", notes="获修改/完善用户信息",httpMethod = "POST")
    @PostMapping("/user/updateUserInfo")
    GraceJSONResult updateUserInfo(@RequestBody @Valid UpdateUserInfoBO updateUserInfoBO);


    @ApiOperation(value = "根据用户的 Id 查询用户列表", notes="根据用户的 Id 查询用户列表",httpMethod = "GET")
    @GetMapping("/user/queryByIds")
    GraceJSONResult queryByIds(@RequestParam("userIds") String userIds);

}
